
*** Set paths
local dir "..."
local dropbox_data "..."
local dropbox_data_create "..."
local local_data "..."
local dropbox_fig "..."
local dropbox_tab "..."


************************************************************
*** SET GLOBALS
************************************************************

*** DATA SAMPLE
global F=100

global yas =1
	*=1 use yas yields instead of raw data
global fill = 1
	*=1 means filling missing quotes (recall that we only have Bloomberg quotes from 7:00-16:00)	
global smoothing=1
	*=1 smooth out yield/theta outliers using theta
	
	global percL = 1
	global percU = 99

global size = 25
	*Info: *Bloomberg are quoted up to 25 million (buy and sell) and some times 10 million.  If you want something different you call your dealer. 

global trackclient = 0
	*=1 keep only trackclient!="no", clients that we can trace over time 

global open_can = 1	
	*=1 keep only when CanDeal is open -> this is only for Matlab data

global norm=1
	*normalize all yields by feh, fes
	
***REGRESSIONS
global parentdealer =0
	*=1 use 8801 as 88 and so forth as reporting dealer
	
global basedealer =67
	*choose the dealer that is dealer =0 in the IO model
	
global allauctions=0
	*=0 use only regular auctions
	*=2 use all but switch auctions

global quantityrobust=0
	*=1 restrict sample: exclude large quantities
	*=0 full sample
		
global exclude_dates = 1000000 // days to exclude after auction (1000 is like exclude no dates)

global fej = 1
	*=1 with dealer fixed effect 
	*=0 without dealer fixed effect 

global instrument=4
	*=0 use actual amount won
	*=4 use expected winning amount
	
			
***MODEL SPECIFICATION

	*Model with loyalty benefits
		*Baseline: week =1, homedealer=1, keepall=1, largetrade=0
		*Quantity extension: week =1, homedealer=1, keepall=1, largetrade=1
	
	*Model without loyalty benefits 	
		*Baseline: week =1 or week=0, homedealer=0, keepall=1, largetrade=0
	
global week =1
	*=0 means daily
	*=1 means weekly
	*=2 means monthly
	*=-1 means auction-to-auction as a period with at least 2 dates

global homedealer=1

global keepall=1
	*=1 keep all investors
	*=0 keep only investors with LEIs

global largetrade =0
	*=0 don't distinguish between trades
	*=1 separate between large and small trades
	
	
************************************************************************************************************************	
***RUN FILES
************************************************************************************************************************

do "BaseData.do"
include "ModelData.do"
		
if($homedealer ==0 ){
	include "Regressions.do" 
}

if($homedealer ==1 & $largetrade ==0){		
	include "RegressionsHomedealer.do"	 	
}

if($homedealer ==1 & $largetrade ==1){		
	include "RegressionsHomedealer_SL.do"	 	
}


	